/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package podologia.beansDB;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Hernan
 */
@Entity
@Table(name = "diaatencion")
@NamedQueries({@NamedQuery(name = "Diaatencion.findByIdDiaAtencion", query = "SELECT d FROM Diaatencion d WHERE d.idDiaAtencion = :idDiaAtencion"), @NamedQuery(name = "Diaatencion.findByDia", query = "SELECT d FROM Diaatencion d WHERE d.dia = :dia"), @NamedQuery(name = "Diaatencion.findByHoraInicio", query = "SELECT d FROM Diaatencion d WHERE d.horaInicio = :horaInicio"), @NamedQuery(name = "Diaatencion.findByHoraFin", query = "SELECT d FROM Diaatencion d WHERE d.horaFin = :horaFin")})
public class Diaatencion implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    @Column(name = "idDiaAtencion", nullable = false)
    private Integer idDiaAtencion;
    @Column(name = "dia")
    private Integer dia;
    @Column(name = "horaInicio")
    private Long horaInicio;
    @Column(name = "horaFin")
    private Long horaFin;
    @JoinColumn(name = "idEmpleado", referencedColumnName = "legajo")
    @ManyToOne
    private Empleado idEmpleado;

    public Diaatencion() {
    }

    public Diaatencion(Integer idDiaAtencion) {
        this.idDiaAtencion = idDiaAtencion;
    }

    public Integer getIdDiaAtencion() {
        return idDiaAtencion;
    }

    public void setDia(Diaatencion get) {
        throw new UnsupportedOperationException("Not yet implemented");
    }

    public void setIdDiaAtencion(Integer idDiaAtencion) {
        Integer oldIdDiaAtencion = this.idDiaAtencion;
        this.idDiaAtencion = idDiaAtencion;
        changeSupport.firePropertyChange("idDiaAtencion", oldIdDiaAtencion, idDiaAtencion);
    }

    public Integer getDia() {
        return dia;
    }

    public void setDia(Integer dia) {
        Integer oldDia = this.dia;
        this.dia = dia;
        changeSupport.firePropertyChange("dia", oldDia, dia);
    }

    public Long getHoraInicio() {
        return horaInicio;
    }

    public void setHoraInicio(Long horaInicio) {
        Long oldHoraInicio = this.horaInicio;
        this.horaInicio = horaInicio;
        changeSupport.firePropertyChange("horaInicio", oldHoraInicio, horaInicio);
    }

    public Long getHoraFin() {
        return horaFin;
    }

    public void setHoraFin(Long horaFin) {
        Long oldHoraFin = this.horaFin;
        this.horaFin = horaFin;
        changeSupport.firePropertyChange("horaFin", oldHoraFin, horaFin);
    }

    public Empleado getIdEmpleado() {
        return idEmpleado;
    }

    public void setIdEmpleado(Empleado idEmpleado) {
        Empleado oldIdEmpleado = this.idEmpleado;
        this.idEmpleado = idEmpleado;
        changeSupport.firePropertyChange("idEmpleado", oldIdEmpleado, idEmpleado);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDiaAtencion != null ? idDiaAtencion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Diaatencion)) {
            return false;
        }
        Diaatencion other = (Diaatencion) object;
        if ((this.idDiaAtencion == null && other.idDiaAtencion != null) || (this.idDiaAtencion != null && !this.idDiaAtencion.equals(other.idDiaAtencion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "podologia.beansDB.Diaatencion[idDiaAtencion=" + idDiaAtencion + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
